package com.ruoyi.merchant.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.MerchantDataPushApibInfoMapper;
import com.ruoyi.db.domain.MerchantDataPushApibInfo;
import com.ruoyi.merchant.service.IMerchantDataPushApibInfoService;

/**
 * 半流程授权订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-06
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class MerchantDataPushApibInfoServiceImpl implements IMerchantDataPushApibInfoService 
{
    @Autowired
    private MerchantDataPushApibInfoMapper merchantDataPushApibInfoMapper;

    /**
     * 查询半流程授权订单
     * 
     * @param id 半流程授权订单主键
     * @return 半流程授权订单
     */
    @Override
    public MerchantDataPushApibInfo selectMerchantDataPushApibInfoById(Long id)
    {
        return merchantDataPushApibInfoMapper.selectMerchantDataPushApibInfoById(id);
    }

    /**
     * 查询半流程授权订单列表
     * 
     * @param merchantDataPushApibInfo 半流程授权订单
     * @return 半流程授权订单
     */
    @Override
    public List<MerchantDataPushApibInfo> selectMerchantDataPushApibInfoList(MerchantDataPushApibInfo merchantDataPushApibInfo)
    {
        return merchantDataPushApibInfoMapper.selectMerchantDataPushApibInfoList(merchantDataPushApibInfo);
    }

    /**
     * 查询半流程授权订单列表
     *
     * @param merchantDataPushApibInfo 半流程授权订单
     * @return 半流程授权订单
     */
    @Override
    public List<Map<String, Object>> selectMerchantDataPushApibInfoMapList(MerchantDataPushApibInfo merchantDataPushApibInfo)
    {
        return merchantDataPushApibInfoMapper.selectMerchantDataPushApibInfoMapList(merchantDataPushApibInfo);
    }

    /**
     * 新增半流程授权订单
     * 
     * @param merchantDataPushApibInfo 半流程授权订单
     * @return 结果
     */
    @Override
    public int insertMerchantDataPushApibInfo(MerchantDataPushApibInfo merchantDataPushApibInfo)
    {
        merchantDataPushApibInfo.setCreateTime(DateUtils.getNowDate());
        return merchantDataPushApibInfoMapper.insertMerchantDataPushApibInfo(merchantDataPushApibInfo);
    }

    /**
     * 修改半流程授权订单
     * 
     * @param merchantDataPushApibInfo 半流程授权订单
     * @return 结果
     */
    @Override
    public int updateMerchantDataPushApibInfo(MerchantDataPushApibInfo merchantDataPushApibInfo)
    {
        merchantDataPushApibInfo.setUpdateTime(DateUtils.getNowDate());
        return merchantDataPushApibInfoMapper.updateMerchantDataPushApibInfo(merchantDataPushApibInfo);
    }

    /**
     * 批量删除半流程授权订单
     * 
     * @param ids 需要删除的半流程授权订单主键
     * @return 结果
     */
    @Override
    public int deleteMerchantDataPushApibInfoByIds(Long[] ids)
    {
        return merchantDataPushApibInfoMapper.deleteMerchantDataPushApibInfoByIds(ids);
    }

    /**
     * 删除半流程授权订单信息
     * 
     * @param id 半流程授权订单主键
     * @return 结果
     */
    @Override
    public int deleteMerchantDataPushApibInfoById(Long id)
    {
        return merchantDataPushApibInfoMapper.deleteMerchantDataPushApibInfoById(id);
    }
}
